package com.lecyon.farm.mapper;

import com.lecyon.farm.entity.elasticsearch.SimpleGps;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * ElasticsearchRepository --> ElasticsearchCrudRepository --> PagingAndSortingRepository --> CrudRepository
 *
 * @author Yao Zheng
 * @Date 2020/4/29 13:12
 */
@Component
public interface SimpleGpsRepository extends ElasticsearchRepository<SimpleGps, String> {

    /**
     * @param carId
     * @param commandID
     * @return
     */
    List<SimpleGps> findByCarIdAndCommandIDAndTimeBetween(String carId, String commandID, String beginTime, String endTime);

    /**
     * @param carId
     * @param commandID
     * @return
     */
    List<SimpleGps> findByCarIdAndCommandID(String carId, String commandID);
}
